{$CLEO .cs}
{$use cleo+}
0000:
 
model.Load(#WMYBOUN) 
model.Load(#BMYBOUN) 
model.Load(#SNIPER) 
model.Load(#CUNTGUN) 
038B: load_requested_models


const

Found_target =   19@
Random_victims = 10@
FAKE1=5@
FAKE2=6@
FAKE3=7@
FAKE4=8@
not_marker1=9@
not_marker2=10@
not_marker3=11@
not_marker4=12@
end
Found_target = false 

if not marker_enabled 1@
then
   1@ = marker.CreateIconAndSphere(37,  -544.6954, 2594.8406, 53.5156)
end
while $onmission >= 1   
wait 0      
    if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -544.6954 2594.8406 53.5156 radius 100.0 100.0 100.0
    then
 

            if   and
              02A0:   actor $PLAYER_ACTOR stopped
              00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere   -544.6954 2594.8406 53.5156  radius 4.0 4.0 4.0
            then
                 goto @Target
            end

             wait 100   
          
    else 
      
            if  marker_enabled 2@
            then
                marker.Disable(2@ )
            end        
        wait 100
    end 
    
 
end 

:Target
show_styled_text "~w~Look for the target" 4000 5
 add_text_label "@hitman" "Get at least 25000 RP and he'll show up."
 0512: show_permanent_text_box '@hitman'  // If your health reaches zero, you will pass out and you will be treated at the local medical center.

while $onmission >= 1 
wait 0
0208: 13@ = random_float_in_ranges 100.0 200.0
0208: 14@ = random_float_in_ranges 100.0 00.0

04C4: store_coords_to 20@ 21@ 22@ from_actor $PLAYER_ACTOR with_offset 13@ 14@ 0.0
02C0: store_to  23@ 24@ 25@ ped_path_coords_closest_to  20@ 21@ 22@
if or
$P1_RP_Score >= 25000
$P2_RP_Score >= 25000
then
   Found_target = true 
end
{
if  and
02D8:   actor $PLAYER_ACTOR current_weapon == 34
02E0:   actor $PLAYER_ACTOR firing_weapon

then 
           Found_target = true 
end  
if coop
then
    if  and
    02D8:   actor player2 current_weapon == 34
    02E0:   actor player2 firing_weapon
    
    then 
               Found_target = true 
    end  

end       }
      if  and 
      not is_actor_defined  0@ 
      Found_target == true  
      then
          gosub @Scan
          0@ = actor.Create(gang6, #bMYBOUN , 23@, 24@, 25@ )
          actor.Health(0@)= 3000
          actor.GiveWeaponAndAmmo(0@, SniperRifle ,88888)
          actor.WeaponAccuracy(0@)=60
          0446: set_actor 0@ dismemberment_possible 0
          07DD: set_actor 0@ attack_rate 75 // previously known as temper_to 
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 0@ acquaintance 3 to_actors_pedtype 6 // see ped.dat
          07FE: set_actor 0@ fighting_style_to 7 moves 6
          
          081A: set_actor 0@ weapon_skill_to 2
          05DE: AS_actor 0@ walk_around_ped_path
         0946: set_actor 0@ actions_uninterupted_by_weapon_fire 1

          marker.CreateAboveActor(2@,0@)
          gosub @Scan
          fake1 = actor.Create(gang6, #WMYBOUN , 23@, 24@, 25@ )
          actor.Health(fake1)= 750
          actor.GiveWeaponAndAmmo(fake1, SniperRifle ,88888)
          actor.WeaponAccuracy(fake1)=35
          0446: set_actor fake1 dismemberment_possible 0
          07DD: set_actor fake1 attack_rate 50 // previously known as temper_to 
          077A: set_actor fake1 acquaintance 3 to_actors_pedtype 0 // see ped.dat
          077A: set_actor fake1 acquaintance 3 to_actors_pedtype 1 // see ped.dat
          077A: set_actor fake1 acquaintance 3 to_actors_pedtype 6 // see ped.dat
          07FE: set_actor fake1 fighting_style_to 15 moves 6
          05DE: AS_actor fake1 walk_around_ped_path
          081A: set_actor fake1 weapon_skill_to 1
          marker.CreateAboveActor(not_marker1,fake1)       
          gosub @Scan
          fake2 = actor.Create(gang6, #bMYBOUN , 23@, 24@, 25@ )
          actor.Health(fake2)= 750
          actor.GiveWeaponAndAmmo(fake2, SniperRifle ,88888)
          actor.WeaponAccuracy(fake2)=35
          0446: set_actor fake2 dismemberment_possible 0
          07DD: set_actor fake2 attack_rate 50 // previously known as temper_to 
          077A: set_actor fake2 acquaintance 3 to_actors_pedtype 0 // see ped.dat
          077A: set_actor fake2 acquaintance 3 to_actors_pedtype 1 // see ped.dat
          077A: set_actor fake2 acquaintance 3 to_actors_pedtype 6 // see ped.dat
          07FE: set_actor fake2 fighting_style_to 15 moves 6
          05DE: AS_actor fake2 walk_around_ped_path
          081A: set_actor fake2 weapon_skill_to 1
          marker.CreateAboveActor(not_marker2,fake2)       
          gosub @Scan
          fake3 = actor.Create(gang6, #WMYBOUN , 23@, 24@, 25@ )
          actor.Health(fake3)= 750
          actor.GiveWeaponAndAmmo(fake3, SniperRifle ,88888)
          actor.WeaponAccuracy(fake3)=35
          0446: set_actor fake3 dismemberment_possible 0
          07DD: set_actor fake3 attack_rate 50 // previously known as temper_to 
          077A: set_actor fake3 acquaintance 3 to_actors_pedtype 0 // see ped.dat
          077A: set_actor fake3 acquaintance 3 to_actors_pedtype 1 // see ped.dat
          077A: set_actor fake3 acquaintance 3 to_actors_pedtype 6 // see ped.dat
          07FE: set_actor fake3 fighting_style_to 15 moves 6
          05DE: AS_actor fake3 walk_around_ped_path
          081A: set_actor fake3 weapon_skill_to 1
          marker.CreateAboveActor(not_marker3,fake3)       
          gosub @Scan
          fake4 = actor.Create(gang6, #bMYBOUN , 23@, 24@, 25@ )
          actor.Health(fake4)= 750
          actor.GiveWeaponAndAmmo(fake4, SniperRifle ,88888)
          actor.WeaponAccuracy(fake4)=35
          0446: set_actor fake4 dismemberment_possible 0
          07DD: set_actor fake4 attack_rate 50 // previously known as temper_to 
          077A: set_actor fake4 acquaintance 3 to_actors_pedtype 0 // see ped.dat
          077A: set_actor fake4 acquaintance 3 to_actors_pedtype 1 // see ped.dat
          077A: set_actor fake4 acquaintance 3 to_actors_pedtype 6 // see ped.dat
          07FE: set_actor fake4 fighting_style_to 15 moves 6
          05DE: AS_actor fake4 walk_around_ped_path
          081A: set_actor fake4 weapon_skill_to 1
          marker.CreateAboveActor(not_marker4,fake4)       
             
          show_styled_text "~r~Target locations revealed!~N~~r~Kill the real target!" 4000 5
          03E6: remove_text_box

      end
      if  and
      is_actor_defined fake1
      is_actor_defined fake2
      is_actor_defined fake3
      is_actor_defined fake4
      then
          if actor.Dead(fake1)
          then
              018B: set_marker not_marker1 radar_mode 0
          end
          if actor.Dead(fake2)
          then
             018B: set_marker not_marker2 radar_mode 0
          end
          if actor.Dead(fake3)
          then
             018B: set_marker not_marker3 radar_mode 0
          end
          if actor.Dead(fake4)
          then
             018B: set_marker not_marker4 radar_mode 0
          end
      end
      if is_actor_defined   0@
      then
          if actor.Dead(0@)
          then
              show_styled_text "~y~Target eliminated!~n~~b~Reward~n~~w~$5000" 4000 5
              0109: player $PLAYER_CHAR money += 2500
              018C: play_sound 1052 at 0.0 0.0 0.0
              $HITMAN_DESTROYED += 1 
              $HITMAN_DESTROYED_SF += 1 
              break
          end
      
      end 
end
03E6: remove_text_box

//Cleanup 
if is_actor_defined  0@
then
    actor.RemoveReferences( 0@ )
end 
if is_actor_defined  fake1
then
    actor.RemoveReferences( fake1 )
end 
if is_actor_defined  fake2
then
    actor.RemoveReferences( fake2)
end 
if is_actor_defined  fake3
then
    actor.RemoveReferences( fake3 )
end 
if is_actor_defined  fake4
then
    actor.RemoveReferences( fake4 )
end 


if  marker_enabled 1@
then
marker.Disable(1@ )
end        
if  marker_enabled 2@
then
marker.Disable(2@ )
end             
if  marker_enabled  not_marker1
then
marker.Disable(not_marker1 )
end             
if  marker_enabled  not_marker2
then
marker.Disable(not_marker2)
end             
if  marker_enabled  not_marker3
then
marker.Disable(not_marker3)
end             
if  marker_enabled  not_marker4
then
marker.Disable(not_marker4)
end              
model.destroy(#WMYBOUN) 
model.destroy(#BMYBOUN) 
model.destroy(#SNIPER)
model.destroy(#CUNTGUN)
 
terminate_this_custom_script

:Scan
0208: 13@ = random_float_in_ranges 150.0 200.0
0208: 14@ = random_float_in_ranges 150.0 200.0

04C4: store_coords_to 20@ 21@ 22@ from_actor $PLAYER_ACTOR with_offset 13@ 14@ 0.0
02C0: store_to  23@ 24@ 25@ ped_path_coords_closest_to  20@ 21@ 22@

return